The Dreamweaver JavaScript API > Behavior functions > dom.addBehavior()

 

dom.addBehavior()

Availability

Dreamweaver 3.0

Description

Adds a new event/action pair to the selected element. This function is valid only for the active document.

Arguments

event, action, {eventBasedIndex}

event is the JavaScript event handler that should be used to attach the behavior to the element; for example, onClick, onMouseOver, or onLoad.
action is the function call that would be returned by applyBehavior() if the action were added using the Behaviors panel; for example, "MM_popupMsg('Hello World')".
eventBasedIndex is the position at which this action should be added. eventBasedIndex is a zero-based index; if two actions already are associated with the specified event, and you specify eventBasedIndex as 1, this action will be executed between the other two. If this argument is omitted, the action is added after all existing actions for the specified event.

Returns

Nothing.

Enabler

None.